<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/conn.asp"-->
<%
If (Request.QueryString("clid") <> "") Then
  clid = Request.QueryString("clid")
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="lib/sheet.css" type="text/css">
<title>无标题文档</title>
</head>
<%

if request.form("mm_edit")<>"" then
	cph=request.form("cph")
	clm=request.form("clm")
	sscd=request.form("sscd")
	'sql="select * from cl where cph='"&cph&"'"
	'set chongfu=server.createobject("adodb.recordset")
	'chongfu.open sql,conn,1,1
	'if not chongfu.eof then	error_write "2","车牌号重复，请检查！"
	set cmd=Server.CreateObject("ADODB.Command")
	cmd.ActiveConnection = conn
	sql="update cl set cph='"&cph&"',clm='"&clm&"',sscd="&sscd&" where clid="&clid
	'response.Write(sql)
	cmd.CommandText = sql
	cmd.Execute
	view_url="manage_cl.asp"
	response.Redirect(view_url)
end if



clid=request.QueryString("clid")
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.ActiveConnection = conn
	rs.CursorType = 1
	rs.CursorLocation = 2
	rs.LockType = 3
	rs.Source = "SELECT * FROM cl WHERE clid = " + Replace(clid, "'", "''") + ""
	rs.Open()

%>

<body>

<form name="form1" method="post" action="edit_cl.asp?clid=<%=clid%>">
<table cellspacing="1" cellpadding="2" border="0" bgcolor="black" width="100%">
    <tr bgcolor="silver">
      <th scope="col">ID</th>
      <th scope="col">车牌号</th>
      <th scope="col">车辆名</th>
      <th scope="col">所属车队</th>
    </tr>
    <tr bgcolor="#efefef" align="center">
      <td><%=rs("clid")%></td>
      <td><input name="cph" type="text" id="cph" size="10" value="<%=rs("cph")%>"></td>
      <td><input name="clm" type="text" id="clm" size="10" value="<%=rs("clm")%>"></td>
      <td>
		<select name="sscd">
		<%
			set cd = Server.CreateObject("ADODB.Recordset")
			sql="select * from cd"
			cd.open sql,conn,1,1
			while not cd.eof
		%>
			<option value="<%=cd("cdid")%>" <%if cd("cdid")=rs("sscd") then response.write("selected")%>><%=cd("cdm")%></option>
		<%
				cd.movenext()
			wend
			cd.close

		%>
		</select>
	  </td>
    </tr>
    <tr bgcolor="silver">
      <td colspan="10"><div align="center">
        <input type="submit" name="Submit" value="提交">
        &nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="Reset" value="重置">
        <input type="hidden" name="mm_edit" value="true">
      </div></td>
    </tr>
  </table>
</form>
<p><a href="javascript:history.go(-1)">&lt;&lt;返回上一页</a></p>
</body>
</html>
<%
rs.Close()
Set rs = Nothing
%>
